package GameCore;

import java.io.*;
import java.net.*;

public class Client 
{
    InetAddress _ipAddress;
    int _port;
    public DataTransmission trans;
    
    public void Init(InetAddress ipAddress,int port)
    {
        _ipAddress = ipAddress;
        _port = port;
        trans = new DataTransmission();
    }
    
    public boolean ConnectToServer()
    {
        try
        {
            trans.connectSocket = new Socket(_ipAddress,_port);
            trans.Init();
            return true;
        }
        catch(IOException ioex)
        {
            return false;
        }
    }
 
    public boolean DicconectToServer()
    {
        return trans.Close();
    }
}
